<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>第一次作业</title>
</head>
<script>
    /*
    189000526-谭静*/
    document.write( ' 18900052-谭静'+'<br/> ');
    //三角形
    document.write("三角形:"+'<br/> ');
    for(var j = 1;j< 6;j ++){
        for(var a = 4;a >= j;a --){
        document.write( "&nbsp&nbsp&nbsp");
        }
        for(var i = 1;i <= j;i ++){
        document.write( "*&nbsp&nbsp&nbsp&nbsp");
        }
    document.write( "<br/>");
    }

    // function sjx(i,j){
    //     for(var j = 1;j< 6;j ++){
    //     for(var a = 4;a >= j;a --){
    //     document.write( "&nbsp&nbsp&nbsp");
    //     }
    //     for(var i = 1;i <= j;i ++){
    //     document.write( "*&nbsp&nbsp&nbsp&nbsp");
    //     }
    // document.write( "<br/>");
    // }
    // }
    //菱形
    document.write("菱形:"+'<br/> ' );
    for (var i = 1; i<=5; i++){if(i % 2 != 0){
        for (var j = 1; j <=5-i ; j++){
        document.write( "&nbsp&nbsp")
        }
        for (var j = 1; j <=i ; j++){
        document.write( "*&nbsp ")
        }
        document.write( "<br>");
    }
    }
    for (var i = 1; i <=5; i++){
        if(i % 2 == 0){
            for (var j = 1; j <=i ; j++) {
            document.write( "&nbsp&nbsp")
            }
            for (var j = 1; j <=5-i ; j++){
            document.write( "*&nbsp ")
            }
            document.write( "<br>");
        }
    }


    //平行四边形
    document.write("平行四边形:"+'<br/>');
    for (var i = 0; i< 5; i++) {
        for (var j = 0; j < 5-i ; j++){
        document.write( "&nbsp")
        }
        for (var j = 0; j<5 ; j++){
        document.write( "*&nbsp")
        }
        document.write( "<br>");
    }

</script>
        
<body>
    
</body>
</html>